#include "dri_fan.h"
#include "dri_led.h"
#include "dri_beep.h"
#include "dri_systick.h"
#include "dri_key.h"
#include "dri_exti.h"
#include "dri_usart.h"
#include "dri_dma.h"
#include "dri_time.h"
#include "dri_sht20.h"
#include "dri_spi.h"
#include "dri_adc.h"
#include "dri_seg.h"
#include "FreeRTOS.h"
#include "task.h"
#include "stdio.h"
#include "dri_servo.h"


int main(void)
{
//	BaseType_t ret;
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	dri_systick_init(168);
	dri_led_init();
	dri_beep_init();
	//dri_led_open();
	dri_fan_init();
	dri_servo_init();
//	dri_exti9_init();*/
	dri_usart6_init();
	dri_usart2_init();
	//dri_sht20_init();
	//dri_time13_init();
	//dri_sht20_reset();
	//dri_spi2_init();
	//dri_74hc595_init();
	//dri_dma_init(dma_src,dma_drc,10);
	//dri_dmadata_compare();
	dri_adc1_init();
	dri_systick_ms(10);
	
	printf("hello \r\n");
	
	while(1)
	{
		int angle=0;
		
		for( angle = 0; angle <= 180; angle += 10)
			{
				servo_set_angle(angle);
				dri_systick_ms(100);
			}
			
			for(angle = 180; angle >= 0; angle -= 10)
			{
				servo_set_angle(angle);
				dri_systick_ms(100);
			}

	}
	
}



